﻿<!DOCTYPE html>
<html>
<head>
    <title>选择付款单位</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/ViewV5/CSS/icfont_qj/iconfont.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/animate.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/bootstrap3.3.5/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/default.css">
    <link rel="stylesheet" type="text/css" href="/ViewV5/CSS/index.css">
</head>
<body ms-controller="appview">

    <div>
        <!-- 按条件选择 -->
        <div class="tab-filter-type" style="margin-top: 20px;">



            <!-- 搜索 -->
            <div class="oh">
                <div class="input-group ml15" style="width: 295px;">
                    <input type="search" class="form-control" id="search" ms-duplex="search.searchcontent" placeholder="输入名称">
                    <span class="input-group-addon" ms-click="GetLIST()">搜索</span>
                </div>
            </div>
        </div>

        <div class="default-tab ft14 pt20 hover-btn">
            <table class="table table-striped table-responsive table-hover">
                <thead>
                    <tr>
                        <th class="tc" style="width: 100px">选择</th>
                        <th>收款单位</th>
                        <th>收款开户行</th>
                        <th>收款开户联行号</th>
                        <th>收款账号</th>

                    </tr>
                </thead>
                <tbody>
                    <tr ms-repeat-el="tmpListData" ms-click="selData(el)">
                        <td class=" tc">
                            <div class="icheckbox_square-blue" ms-class-1="checked:el.issel">
                                <span class="iconfont icon-check ft12"></span>
                            </div>
                        </td>

                        <td>{{el.SKDW}}</td>
                        <td>{{el.skkhh}}</td>
                        <td>{{el.khhlhh}}</td>
                        <td>{{el.skzh}}</td>


                    </tr>

                </tbody>
                <tfoot>
                    <tr ms-if="isnull">
                        <td class="tc"></td>
                        <td>暂无数据</td>
                    </tr>
                </tfoot>
            </table>
            <div class="ui-datatable-page ft14 pl20">

                <div id="pageDiv" class="pull-right"></div>
                <div class="pull-right" ms-visible="tmpListData.size()!=0">
                    <span>共{{page.total}}条记录</span>
                    <span ms-visible="model.page.total>model.pageNum[0].num">选择每页条数
                        <select style="height: 25px; width: 50px;" ms-change="selNum(this.value)" ms-duplex="model.page.pagecount">
                            <option ms-repeat-pg="pageNum" ms-attr-value="pg.num" ms-attr-selected="pg.num==model.page.pagecount?'selected':''">{{pg.num}}</option>
                        </select>
                    </span>
                </div>

            </div>
        </div>


    </div>

    <script src="/ViewV5/JS/jquery-1.11.2.min.js" type="text/javascript"></script>
    <script src="/ViewV5/JS/laypage/laypage.js"></script>
    <script src="/ViewV5/JS/avalon.js"></script>
    <script src="/ViewV5/JS/SZHLCommon.js?jsver=20170915"></script>

    <script type="text/javascript">
        //$(".crm-tab .fa").check(function(){
        //	$(this).addClass("fa-check-square")
        //})
        $(document).on("click", ".tab-type li span", function () {
            $(this).addClass("active").parent().siblings().children().removeClass("active")
        });//筛选类型
        var model = avalon.define({
            $id: "appview",
            userName: ComFunJS.getnowuser(),
            search: { seartype: "", searchcontent: "" },
            SelectType: function (type) {
                model.search.seartype = type;
                model.GetLIST();
            },
            searchcontent: "",
            tmpListData: [],
            selNum: function (item) {    //选择显示的条数
                model.page.pagecount = item;
                model.GetLIST();
            },
            page: { pageindex: 1, pagecount: 10, total: 0 }, //分页参数
            pageNum: [{ "num": 10 }, { "num": 20 }, { "num": 30 }, { "num": 50 }, { "num": 100 }],
            Total: 0,
            selData: function (el) {
                for (var i = 0; i < model.tmpListData.length; i++) {
                    model.tmpListData[i].issel = false;
                }
                el.issel = !el.issel;
            },
            getseldata: function () {
                var temp = [];
                for (var i = 0; i < model.tmpListData.length; i++) {
                    if (model.tmpListData[i].issel) {
                        temp.push(model.tmpListData[i].$model);
                    };
                }
                return temp;
            },
            GetLIST: function () {
                model.page.pageindex = 1;
                model.tmpListData.clear();
                $.getJSON('/API/VIEWAPI.ashx?Action=ZCZX_GETSKDWLISTPAGE', { p: 1, P1: $("#search").val(), pagecount: model.page.pagecount, P2: "26" }, function (resultData) {
                    if (resultData.ErrorMsg == "") {
                        for (var i = 0; i < resultData.Result.length; i++) {
                            resultData.Result[i].issel = false;
                        }
                        model.tmpListData = resultData.Result;
                        model.page.total = resultData.Result1;
                        laypage({
                            cont: 'pageDiv', //容器。值支持id名、原生dom对象，jquery对象。
                            pages: Math.ceil(parseInt(resultData.Result1) * 1.0 / model.page.pagecount), //通过后台拿到的总页数
                            curr: 1, //初始化当前页
                            skin: 'molv',
                            jump: function (e) { //触发分页后的回调
                                if (e.curr != model.page.pageindex) {
                                    $.getJSON('/API/VIEWAPI.ashx?Action=ZCZX_GETSKDWLISTPAGE', { p: e.curr, P1: $("#search").val(), pagecount: model.page.pagecount, P2: "26" }, function (resultData) {
                                        if (resultData.ErrorMsg == "") {
                                            for (var m = 0; m < resultData.Result.length; m++) {
                                                resultData.Result[m].issel = false;
                                            }
                                            model.tmpListData = resultData.Result;
                                        }
                                    })
                                    model.page.pageindex = e.curr;
                                }
                            }
                        });
                    }
                })
            }
        })

        avalon.ready(function () {
            model.GetLIST();

        })
    </script>
</body>
</html>
